package com.settlement.system.service.impl;

import com.settlement.system.mapper.BaseMapper;
import com.settlement.system.mapper.TblWpVendorUncommonShopConfigMapper;
import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.service.ITblWpVendorUncommonShopConfigService;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;

/**
 * 唯品会商户不寻常店铺设置 服务实现类
 * @author Ximi
 * @since 2020-04-15
 */
@Service
public class TblWpVendorUncommonShopConfigServiceImpl extends BaseServiceImpl implements ITblWpVendorUncommonShopConfigService {

    @Resource
    private TblWpVendorUncommonShopConfigMapper tblWpVendorUncommonShopConfigMapper;

    @Override
    public BaseMapper init() {
        return tblWpVendorUncommonShopConfigMapper;
    }

    @Override
    public void updateStatus(String id, Integer status) throws ServiceException {
        try {
            tblWpVendorUncommonShopConfigMapper.updateStatus(id, status);
        } catch (Exception ex) {
            throw new ServiceException("更新状态异常", ex);
        }
    }

    @Override
    public Integer selectCountByVdb(String vendorCode, Integer deliveryType, String brandUnitNo) throws ServiceException {
        try {
            return tblWpVendorUncommonShopConfigMapper.selectCountByVdb(vendorCode, deliveryType, brandUnitNo);
        } catch (Exception ex) {
            throw new ServiceException("更新状态异常", ex);
        }
    }

    @Override
    public Integer selectCountByVdbs(String vendorCode, Integer deliveryType, String brandUnitNo, String shopNo) throws ServiceException {
        try {
            return tblWpVendorUncommonShopConfigMapper.selectCountByVdbs(vendorCode, deliveryType, brandUnitNo, shopNo);
        } catch (Exception ex) {
            throw new ServiceException("更新状态异常", ex);
        }
    }
}

